package org.zsl.mapper;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import org.zsl.model.Category;

public interface CategoryMapper {

    /**
     *  1. 增删改查
     *  2. 判断存在
     * */



    @Select("select * from category where category_id=#{categoryId}")
    @Results(id = "categoryMap",value = {
            @Result(column = "category_id",property = "categoryId"
            ,jdbcType = JdbcType.INTEGER,id = true),
            @Result(column = "name",property = "name",jdbcType = JdbcType.VARCHAR)
    })
    Category selectById(Integer categoryId);

}
